﻿using System;
using System.Collections.Generic;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using MongoDB.Driver.Core.Configuration;
using MySqlSugar;

namespace Avno1Spider.DB
{
    public class DBContext
    {
        private readonly static string connStr =
            @"server=localhost;user id=root;password=xgxxgx;persistsecurityinfo=True;database=avno1";

        public static SqlSugarClient GetInstance()
        {
            SqlSugarClient db = new SqlSugarClient(connStr);
            db.IsEnableLogEvent = true;//Enable log events
            db.LogEventStarting = (sql, par) => { Console.WriteLine(sql + " " + par + "\r\n"); };
            return db;
        }
    }
}
